<?php
namespace app\index\model;
use think\Model;
class User extends model{
	function findall($username,$password){
		// 后天1,总监2,大股东3,股东4,总代5,代理6,会员7
		$num = $this->where(['username'=>$username,'password'=>$password,"types"=>7])->find();
		return $num;
	}
	function findpot($id){
		$res = db('user')->where('id',$id)->find();
		return $res['betes'];
	}
	function finds($id){
		$result = $this->where('id',$id)->find();
		$result['m'] = $result['moneys']-$result['employ'];
		return $result;
	}
	function ss($id){
		$result = $this->where('id',$id)->find();
		return $result;
	}
	function findprice($id){
		$res = db('user')->where('id',$id)->find();
		return $res;
	}
	function findusername($id,$pw){
		$result = $this->where(['id'=>$id,'password'=>$pw])->where('types','EQ',7)->find();
		return $result;
	}
}